package com.qf.security1.domain;

import lombok.Data;

@Data
public class R {

    private int code;

    private String msg;
    private Object data;

    public static R success(Object data){
        R r = new R();
        r.setCode(Code.SUCCESS);
        r.setData(data);
        return r;
    }

    public static R error(String msg,int code){
        R r = new R();
        r.setCode(code);
        r.setMsg(msg);
        return r;
    }

    public static R error(String msg){
        R r = new R();
        r.setCode(Code.ERROR);
        r.setMsg(msg);
        return r;
    }
}
